/****************************************************************
* @file   : vpcie.cpp
* @author : NingJian (freegodly@gmail.com)
* @date   : 05/26/21 09:38:05
* @brief   : 
****************************************************************/

#include "vpcie.hpp"

#include <stdlib.h>
#include<cstring>
#include <malloc.h>
#include  <cstdlib>


pcieError_t pcieSetDevice(size_t dev_index)
{
    return OK;
}

pcieError_t pcieDeviceReset()
{
    return OK;
}

pcieError_t pcieSetDeviceFlags(uint32_t flags)
{
     return OK;
}

pcieError_t pcieDeviceSetCacheConfig(CacheConf cc)
{
    return OK;
}

pcieError_t pcieDeviceSynchronize(){
    return OK;
}

pcieError_t pcieMalloc(void ** out , size_t length)
{
    *out = std::calloc(1,length);
    return OK;
}

pcieError_t pcieMemcpy(void * dest ,void * src, size_t length){
    memcpy(dest, src, length);
    return OK;
}

pcieError_t pcieMemcpyToSymbolA(void * symbol,const void* src, size_t count, size_t offset)
{
     memcpy(symbol, src + offset, count);
     return OK;
}

pcieError_t pcieMemcpyFromSymbolA(void * dst,const void* symbol, size_t count, size_t offset){
    memcpy(dst, symbol + offset, count);
    return OK;
}